package com.example.gateway.designPattern.simpleFactory.jdgc;

import com.example.gateway.designPattern.simpleFactory.CheesePizza;
import com.example.gateway.designPattern.simpleFactory.PepperPizza;
import com.example.gateway.designPattern.simpleFactory.Pizza;

/**
 * @ClassName: PizzaFactory
 * @Description:
 * @Author: YourName
 * @Date: 2024/12/31
 */

public class PizzaFactory {
    public static Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new CheesePizza();
        }else if (orderType.equals("pepper")) {
            pizza = new PepperPizza();
        }
        return pizza;
    }
}
